package com.gzx.bi.modular.repayment.client.mapper;

import com.gzx.bi.modular.repayment.client.entity.GzxRepaymentClient;
import com.gzx.bi.modular.repayment.client.vo.GzxRepaymentClientVo;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;
import vip.xiaonuo.common.mapper.BaseMapperPlus;

/**
 * @author zjt
 * @description
 * @since 2025/4/1 16:23
 */
public interface GzxRepaymentClientMapper extends BaseMapperPlus<GzxRepaymentClient, GzxRepaymentClientVo> {

    @Insert("<script>" +
            "insert into gzx_repayment_client " +
            "(project_code, debtor_user_no, repayment_date, repayment_amount, overdue_date," +
            "overdue_days, batch, all_json,dept_id ,tenant_id, create_user, create_time) values ${valSql}" +
            "</script>")
    void insertBatchByValSql(String valSql);

    @Select("select min(id) from gzx_repayment_client where repayment_date >= #{currentMont}")
    Long selectCurrentMonthMinId(String currentMont);
}
